<?php
/**
 * Zhub - A PHP Framework For API Developer
 *
 * This file is part of the Zhub package.
 *
 * (c) YiLong Fan <fantiq@163.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @author fanyilong <fantiq@163.com>
 * @copyright 2017 fanyilong. All rights reserved.
 * @package Zhub
 * @date 18-2-28
 */

namespace Zhub\Prototype\Objective\Clazz\Exceptions;

use Exception;
use Throwable;

class InvalidNameException extends Exception
{
    public function __construct($name, $rule = false, Throwable $previous = null)
    {
        $code = 10011;
        $message = $rule ? "invalid variable rule for `$name`" : "cannot use reserved word `$name` as name";
        parent::__construct($message, $code, $previous);
    }
}